package com.erp.remote.information;


import com.erp.entity.information.User;
import com.erp.util.AjaxResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.HashSet;
import java.util.Map;

@RequestMapping("/information/user")
public interface UserRemote {

    @RequestMapping("/allUser")
    AjaxResult allUser();

    /**
     * 分页查询所有用户----后续要修改，要加上companyId
     *
     * @param pageNum
     * @param pageSize
     * @return
     */
    @RequestMapping("/selectAllUserByPage")
    AjaxResult selectAllUserByPage(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum, @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize);


    @RequestMapping("/selectUserById")
    AjaxResult selectUserById(@RequestParam("userId") Integer userId);

    @RequestMapping("/selectUserByCompanyId")
    AjaxResult selectUserByCompanyId(@RequestParam("companyId") Integer companyId);


    @PostMapping("/selectUserInIDSet")
    AjaxResult selectUserInIDSet(@RequestBody HashSet<Integer> userIds);


    @RequestMapping("/getUserByDescription")
    AjaxResult getUserByDescription(@RequestBody Map<String, Object> params);


    @RequestMapping("/addUser")
    AjaxResult addUser(@RequestBody Map<String, Object> params);


    @RequestMapping("/checkUserOnly")
    AjaxResult checkUserOnly(@RequestParam("userCode") String userCode);


    /**
     * 修改用户的代码
     *
     * @param params
     * @return
     */
    @PostMapping("/updateUser")
    AjaxResult updateUser(@RequestBody Map<String, Object> params);


    /**
     * 根据companyId只查用户表中的数据
     * @param companyId
     * @return
     */
    @PostMapping("/selectOnUserByCompanyId")
    AjaxResult selectOnUserByCompanyId(@RequestParam("companyId") Integer companyId);

    /**
     * 传出新对象对应列表
     */
    @PostMapping("/selectUserPositionListByDescription")
    AjaxResult selectUserPositionListByDescription(@RequestBody Map<String, Object> params);

    @PostMapping("/selectUserListByPositionId")
    AjaxResult selectUserListByPositionId(@RequestParam("positionId") Integer positionId,@RequestParam("companyId") Integer companyId);

   @PostMapping("/updateUserPersonalInformation")
        AjaxResult updateUserPersonalInformation(@RequestBody User user);

}
